<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let num = +prompt('请输入秒数')
        function time(t) {

            let s = parseInt(t % 60)
            let m = parseInt(t / 60 % 60)
            let h = parseInt(t / 60 / 60 % 24)
            s = s < 10 ? '0' + s : s
            m = m < 10 ? '0' + m : m
            h = h < 10 ? '0' + h : h
            return `${t}s可以转化为${h}时${m}分${s}秒`

        }
        let re = time(num)
        console.log(re)
        console.log(s);

    </script>
</body>

</html>